package meijuli.com.join51.business.location;

import android.content.Context;

import com.amap.api.location.AMapLocation;
import com.amap.api.maps2d.AMap;
import com.amap.api.services.core.PoiItem;
import com.jhx.common.framework.BasePresenter;
import com.jhx.common.framework.BaseView;

import java.util.List;

/**
 * 约束类
 *
 * @author jack 2017-05-22 16:12
 */
public class Contract {

    public interface LocationView extends BaseView {
        void setData(List<PoiItem> data);
        void locationResult(AMapLocation aMapLocation);
    }

    public static  abstract class LocationPresenter extends BasePresenter<LocationView> {
        /**
         * 搜索附近
         * @param latitude
         * @param longitude
         * @param keyword
         * @param pageIndex
         */
        public abstract void searchNearby(double latitude,
                                 double longitude,
                                 String keyword,
                                 int pageIndex);

        /**
         * 开始定位
         *
         * @param aMap
         */
        public abstract void initLocation(AMap aMap);

        /**
         * 获取上下文对象
         *
         * @return
         */
        abstract void setContext(Context context);
    }
}
